sequenceDiagram
    participant Recipient
    participant Mailchain
    participant SentStore
    participant Chain
    participant AddressIndex

    Recipient->>Mailchain: Get Messages

    Mailchain->>AddressIndex: Get Mailchain transactions
    activate AddressIndex
    AddressIndex-->>Mailchain: List[TransactionData]
    deactivate AddressIndex

    loop Mailchain Messages
        Mailchain->>Chain: Get transaction data
        activate Chain
        Chain-->>Mailchain: Transaction data
        deactivate Chain

        Mailchain-->>Mailchain: Decrypt transaction data
        Mailchain-->>Mailchain: Deserialize transaction data

        Mailchain-->>SentStore: GET: Encrypted message
        activate SentStore
        SentStore-->>Mailchain: 200: Ok
        deactivate SentStore

        Mailchain-->>Mailchain: Verify encrypted hash
        Mailchain-->>Mailchain: Decrypt + parse message
        Mailchain-->>Mailchain: Verify parsed message

    end
    
    Mailchain-->>Recipient: [Messages]
        
